package com.dcyao.musicserve.controller;

import com.dcyao.musicserve.common.R;
import com.dcyao.musicserve.domain.dto.AdminDTO;
import com.dcyao.musicserve.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin")
public class AdminController {
    @Autowired
    private AdminService adminService;

    @PostMapping("/login")
    public R loginStatus(@RequestBody AdminDTO adminRequest) {
        return adminService.verityPasswd(adminRequest);
    }

    @PostMapping("/add")
    public R addUser(@RequestBody AdminDTO adminRequest) {
        return adminService.addUser(adminRequest);
    }
}
